<template>
  <div class="disasterWarningWrap">
    <van-nav-bar
      title="山西预警统计"
      left-text="返回"
      left-arrow
      @click-left="onClickLeft"
    />
    <div class="listArea">
      <div
        class="listLine"
        v-for="(item, index) in listData"
        :key="Number(index)"
        @click="toDetailFile(item)"
      >
        <div class="listLeft">
          <img
            :src="
              require(`@/assets/Earlywarningmap/yujingmap/${item.imageType}-${item.degree}.png`)
            "
            alt=""
          />
        </div>
        <div class="listRight">
          <div class="listCon">
            <span>{{ item.alarmHeadline }}</span>
          </div>
          <!-- <div class="listTime">
            <span>有效日期：</span><span>{{ item.alarmEffective }}</span>
          </div> -->
        </div>
      </div>
      <div v-if="noData" class="noData"><span>暂无更多数据</span></div>
    </div>

    <van-popup
      v-model="showDetail"
      position="right"
      :style="{ width: '100%', height: '100%' }"
    >
      <detail
        v-if="showDetail"
        @detailBack1="showDetail = false"
        :nowClickItem="nowClickItem"
        :yjlist="yjlist"
      >
      </detail>
    </van-popup>
  </div>
</template>
<script type="text/javascript">
import detail from '@/components/disasterWarning/detail.vue'

import Vue from 'vue'
import { Tab, Tabs, Popover } from 'vant'
Vue.use(Popover)
Vue.use(Tab)
Vue.use(Tabs)
export default {
  data() {
    return {
      noData: false,
      showDetail: false,
      yjlist: '',
    }
  },
  props: {
    listData: {
      type: Array,
      default: () => {},
    },
  },
  created() {},
  components: {
    detail,
  },
  methods: {
    toDetailFile(item) {
      this.yjlist = '预警统计'
      this.nowClickItem = item
      this.showDetail = true
    },
    onClickLeft() {
      this.$emit('goback')
    },
  },
}
</script>
<style type="text/css" lang="less" scoped>
.disasterWarningWrap {
  .pageCover();
  background: #f7f8fb;
  background-repeat: no-repeat;
  // background-size: cover;

  overflow-y: auto;
  .yjmap,
  .qy {
    color: #fff;
  }
  .yjmap {
    color: #fff;
    margin-left: 10px;
  }

  .selectArea {
    position: absolute;
    top: 5px;
    right: 80px;
    z-index: 1;
    text-align: center;
    font-size: 14px;
    color: white;
    padding: 10px 0;
  }
  .listArea {
    position: absolute;
    left: 10px;
    right: 10px;

    // bottom:60px;
    height: 90%;
    overflow-y: auto;
    background: white;
    border-radius: 10px;
    top: 8%;
    .listLine {
      overflow: hidden;
      padding: 15px 25px;
      border-bottom: 1px solid #ebedf0;
    }
    .listLeft {
      display: inline-block;
      vertical-align: middle;
      img {
        width: 30px;
      }
    }
    .listRight {
      vertical-align: middle;
      display: inline-block;
      font-size: 16px;
      margin-left: 10px;
      width: 85%;
      .listCon {
        margin-bottom: 10px;
      }
      .listTime {
        font-size: 12px;
        color: #999;
      }
    }
  }
  .van-tabs {
    position: absolute;
    left: 0;
    bottom: 0;
    right: 0;
  }
}
/deep/ .van-popover__arrow {
  left: 80%;
}
/deep/ .van-popover--light {
  width: 80px !important;
}
.tabtop {
  display: flex;
  justify-content: space-evenly;
  height: 45px;
  background: #ffffff;
  box-shadow: 0px 1px 7px 0px rgba(0, 0, 0, 0.08);
  .quansehng {
    display: flex;
    font-size: 14px;
    line-height: 45px;
    font-weight: 500;
    color: #656b75;

    align-items: center;
    img {
      display: block;

      width: 20px;
      height: 20px;
      margin-right: 3px;
    }
  }
  .bendi {
    display: flex;
    font-size: 14px;
    align-items: center;
    line-height: 45px;
    font-weight: 500;
    color: #656b75;

    img {
      display: block;
      width: 20px;
      height: 20px;
      margin-right: 3px;
    }
  }
  .quansehngactive {
    display: flex;
    font-size: 14px;
    line-height: 45px;
    font-weight: 500;
    color: #357cff;
    align-items: center;
    div {
      border-bottom: 2px solid #357cff;
    }
    img {
      display: block;

      width: 20px;
      height: 20px;
      margin-right: 3px;
    }
  }
  .bendiactive {
    display: flex;
    font-size: 14px;
    align-items: center;
    line-height: 45px;
    font-weight: 500;
    color: #357cff;
    div {
      border-bottom: 2px solid #357cff;
    }
    img {
      display: block;
      width: 20px;
      height: 20px;
      margin-right: 3px;
    }
  }
}

/deep/.van-nav-bar__content {
  background: #357cff !important;
}
/deep/ .van-popover__content {
  width: 100px !important;
}
/deep/ .van-popover__action {
  width: 100px !important;
}

.LiveDatabottomTabbar {
  position: absolute;
  .px2rem(left, 20px);
  .px2rem(right, 20px);
  top: 92%;
  bottom: 30px;
  height: 60px;
  overflow: hidden;
  font-size: 18px;
  .leftMyButton {
    float: left;
    padding: 7px;
  }

  .RightMyButton {
    float: right;
    padding: 7px;
  }
}
/deep/ .van-action-sheet__cancel {
  height: 50px;
}
/deep/ .van-action-sheet__item {
  height: 50px;
}
.bottomTabbar {
  position: absolute;
  // .px2rem(left,10px);
  // .px2rem(right,1px);
  top: 810px;
  bottom: 10px;
  height: 45px;
  width: 100%;
  overflow: hidden;
  line-height: 45px;
  display: flex;
  font-size: 16px;
  .dbtn1 {
    display: flex;
    color: white;

    margin: 0px;
    background: url('../assets/baseButton.png');
    background-size: 100% 100%;
    width: 45%;
    border-radius: 10px;
    margin-left: 10px;
    span {
      margin-left: 10px;
    }
    img {
      margin: 10px 0 0 20px;
      width: 25px;
      height: 25px;
    }
  }
  .dbtn2 {
    display: flex;
    color: white;
    margin: 0px;
    background: url('../assets/baseButton.png');
    background-size: 100% 100%;
    width: 45%;
    border-radius: 10px;
    margin-left: 10px;
    span {
      margin-left: 10px;
    }
    img {
      margin: 10px 0 0 20px;
      width: 25px;
      height: 25px;
    }
  }
}
</style>
